package com.scau402.system.domain;

import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.scau402.common.utils.Arith;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.scau402.common.annotation.Excel;
import com.scau402.common.core.domain.BaseEntity;

/**
 * 商品出库单对象 wms_outbound_order
 * 
 * @author ruoyi
 * @date 2023-06-26
 */
public class WmsOutboundOrder extends BaseEntity
{
    private static final long serialVersionUID = 1L;


    private Long clientId;

    private String clientName;

    /** 出库单货品 */
    private List<WmsJade> jades = new ArrayList<>();

    /** id */
    private Long id;


    /** 出借天数 */
    private int lendDays;


    /** 结算周期 */
    private int settlementCycle;

    /** 出库类型(0销售出库、1借货出库、2还货出库、3加工出库) */
    @Excel(name = "出库类型(0销售出库、1借货出库、2还货出库、3加工出库)")
    private String orderType;

    /** 出库单编号 */
    @Excel(name = "出库单编号")
    private String orderCode;

    /** 订单批次 */
    @Excel(name = "订单批次")
    private String orderBatch;

    /** 订单日期 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "订单日期", width = 30, dateFormat = "yyyy-MM-dd")
    private Date orderDate;

    /** 有效期 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "有效期", width = 30, dateFormat = "yyyy-MM-dd")
    private Date validDate;

    /** 供应商主键ID */
    @Excel(name = "供应商主键ID")
    private Long supplierId;

    /** 出库仓位主键ID */
    @Excel(name = "出库仓位主键ID")
    private Long storageId;

    /** 出库仓库主键ID */
    @Excel(name = "出库仓库主键ID")
    private Long warehouseId;

    /** 出库目的仓位主键ID */
    @Excel(name = "出库目的仓位主键ID")
    private Long desStorageId;

    /** 出库目的仓库主键ID */
    @Excel(name = "出库目的仓库主键ID")
    private Long desWarehouseId;

    /** 加工厂主键ID */
    @Excel(name = "加工厂主键ID")
    private Long processorId;

    /** 关联出库单主键 */
    @Excel(name = "关联出库单主键")
    private Long outboundOrderId;

    /** 条形码 */
    @Excel(name = "条形码")
    private String barcode;

    /** 翡翠品类id */
    @Excel(name = "翡翠品类id")
    private Long jadeCategoryId;

    /** 翡翠重量 */
    @Excel(name = "翡翠重量")
    private BigDecimal jadeWeight;

    /** 翡翠数量 */
    @Excel(name = "翡翠数量")
    private Long jadeQuantity;

    /** 翡翠成本价格 */
    @Excel(name = "翡翠成本价格")
    private BigDecimal jadeCost;

    /** 翡翠标签价格 */
    @Excel(name = "翡翠标签价格")
    private BigDecimal jadeTagPrice;

    /** 翡翠销售价格 */
    @Excel(name = "翡翠销售价格")
    private BigDecimal jadeSoldPrice;

    /** 销售结算方式 */
    @Excel(name = "销售结算方式")
    private String settlementType;

    /** 销售结算比率 */
    @Excel(name = "销售结算比率")
    private BigDecimal settlementRatio;

    /** 是否结账（0未结账 1已结账） */
    @Excel(name = "是否结账", readConverterExp = "0=未结账,1=已结账")
    private String isSettle;

    /** 结账日期 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "结账日期", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private Date settleTime;

    /** 结账人ID */
    @Excel(name = "结账人ID")
    private Long settleBy;

    /** 是否需要复核（0不需要 1需要） */
    @Excel(name = "是否需要复核", readConverterExp = "0=不需要,1=需要")
    private String isReview;

    /** 复核用户ID */
    @Excel(name = "复核用户ID")
    private Long reviewUserId;

    /** 是否通过复核（0通过 1不通过） */
    @Excel(name = "是否通过复核", readConverterExp = "0=通过,1=不通过")
    private String reviewOk;

    /** 复核时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "复核时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private Date reviewTime;

    /** 状态(待到货、待卸货、待分拣、已分拣 已合并) */
    @Excel(name = "状态(待到货、待卸货、待分拣、已分拣 已合并)")
    private String status;

    /** 删除标志（0代表存在 2代表删除） */
    private String delFlag;

    /** 租户ID */
    @Excel(name = "租户ID")
    private Long tenantId;

    /** 部门ID */
    @Excel(name = "部门ID")
    private Long deptId;

    public void setId(Long id) 
    {
        this.id = id;
    }

    public Long getId() 
    {
        return id;
    }
    public void setOrderType(String orderType) 
    {
        this.orderType = orderType;
    }

    public String getOrderType() 
    {
        return orderType;
    }
    public void setOrderCode(String orderCode) 
    {
        this.orderCode = orderCode;
    }

    public String getOrderCode() 
    {
        return orderCode;
    }
    public void setOrderBatch(String orderBatch) 
    {
        this.orderBatch = orderBatch;
    }

    public String getOrderBatch() 
    {
        return orderBatch;
    }
    public void setOrderDate(Date orderDate) 
    {
        this.orderDate = orderDate;
    }

    public Date getOrderDate() 
    {
        return orderDate;
    }
    public void setValidDate(Date validDate) 
    {
        this.validDate = validDate;
    }

    public Date getValidDate() 
    {
        return validDate;
    }
    public void setSupplierId(Long supplierId) 
    {
        this.supplierId = supplierId;
    }

    public Long getSupplierId() 
    {
        return supplierId;
    }
    public void setStorageId(Long storageId) 
    {
        this.storageId = storageId;
    }

    public Long getStorageId() 
    {
        return storageId;
    }
    public void setWarehouseId(Long warehouseId) 
    {
        this.warehouseId = warehouseId;
    }

    public Long getWarehouseId() 
    {
        return warehouseId;
    }
    public void setDesStorageId(Long desStorageId) 
    {
        this.desStorageId = desStorageId;
    }

    public Long getDesStorageId() 
    {
        return desStorageId;
    }
    public void setDesWarehouseId(Long desWarehouseId) 
    {
        this.desWarehouseId = desWarehouseId;
    }

    public Long getDesWarehouseId() 
    {
        return desWarehouseId;
    }
    public void setProcessorId(Long processorId) 
    {
        this.processorId = processorId;
    }

    public Long getProcessorId() 
    {
        return processorId;
    }
    public void setOutboundOrderId(Long outboundOrderId) 
    {
        this.outboundOrderId = outboundOrderId;
    }

    public Long getOutboundOrderId() 
    {
        return outboundOrderId;
    }
    public void setBarcode(String barcode) 
    {
        this.barcode = barcode;
    }

    public String getBarcode() 
    {
        return barcode;
    }
    public void setJadeCategoryId(Long jadeCategoryId) 
    {
        this.jadeCategoryId = jadeCategoryId;
    }

    public Long getJadeCategoryId() 
    {
        return jadeCategoryId;
    }
    public void setJadeWeight(BigDecimal jadeWeight) 
    {
        this.jadeWeight = jadeWeight;
    }

    public BigDecimal getJadeWeight() 
    {
        return jadeWeight;
    }
    public void setJadeQuantity(Long jadeQuantity) 
    {
        this.jadeQuantity = jadeQuantity;
    }

    public Long getJadeQuantity() 
    {
        return jadeQuantity;
    }
    public void setJadeCost(BigDecimal jadeCost) 
    {
        this.jadeCost = jadeCost;
    }

    public BigDecimal getJadeCost() 
    {
        return jadeCost;
    }
    public void setJadeTagPrice(BigDecimal jadeTagPrice) 
    {
        this.jadeTagPrice = jadeTagPrice;
    }

    public BigDecimal getJadeTagPrice() 
    {
        return jadeTagPrice;
    }
    public void setJadeSoldPrice(BigDecimal jadeSoldPrice) 
    {
        this.jadeSoldPrice = jadeSoldPrice;
    }

    public BigDecimal getJadeSoldPrice() 
    {
        return jadeSoldPrice;
    }
    public void setSettlementType(String settlementType) 
    {
        this.settlementType = settlementType;
    }

    public String getSettlementType() 
    {
        return settlementType;
    }
    public void setSettlementRatio(BigDecimal settlementRatio) 
    {
        this.settlementRatio = settlementRatio;
    }

    public BigDecimal getSettlementRatio() 
    {
        return settlementRatio;
    }
    public void setIsSettle(String isSettle) 
    {
        this.isSettle = isSettle;
    }

    public String getIsSettle() 
    {
        return isSettle;
    }
    public void setSettleTime(Date settleTime) 
    {
        this.settleTime = settleTime;
    }

    public Date getSettleTime() 
    {
        return settleTime;
    }
    public void setSettleBy(Long settleBy) 
    {
        this.settleBy = settleBy;
    }

    public Long getSettleBy() 
    {
        return settleBy;
    }
    public void setIsReview(String isReview) 
    {
        this.isReview = isReview;
    }

    public String getIsReview() 
    {
        return isReview;
    }
    public void setReviewUserId(Long reviewUserId) 
    {
        this.reviewUserId = reviewUserId;
    }

    public Long getReviewUserId() 
    {
        return reviewUserId;
    }
    public void setReviewOk(String reviewOk) 
    {
        this.reviewOk = reviewOk;
    }

    public String getReviewOk() 
    {
        return reviewOk;
    }
    public void setReviewTime(Date reviewTime) 
    {
        this.reviewTime = reviewTime;
    }

    public Date getReviewTime() 
    {
        return reviewTime;
    }
    public void setStatus(String status) 
    {
        this.status = status;
    }

    public String getStatus() 
    {
        return status;
    }
    public void setDelFlag(String delFlag) 
    {
        this.delFlag = delFlag;
    }

    public String getDelFlag() 
    {
        return delFlag;
    }
    public void setTenantId(Long tenantId) 
    {
        this.tenantId = tenantId;
    }

    public Long getTenantId() 
    {
        return tenantId;
    }
    public void setDeptId(Long deptId) 
    {
        this.deptId = deptId;
    }

    public Long getDeptId() 
    {
        return deptId;
    }

    public List<WmsJade> getJades() {
        return jades;
    }

    public void setJades(List<WmsJade> jades) {
        this.jades = jades;
    }

    public int getLendDays() {
        return lendDays;
    }

    public void setLendDays(int lendDays) {
        this.lendDays = lendDays;
    }

    public int getSettlementCycle() {
        return settlementCycle;
    }

    public void setSettlementCycle(int settlementCycle) {
        this.settlementCycle = settlementCycle;
    }

    public Long getTotalQuantity() {
        Long total = 0L;
        for(WmsJade jade : jades) {
            total += jade.getJadeQuantity();
        }
        return total;
    }

    public Long getClientId() {
        return clientId;
    }

    public void setClientId(Long clientId) {
        this.clientId = clientId;
    }

    public String getClientName() {
        return clientName;
    }

    public void setClientName(String clientName) {
        this.clientName = clientName;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("id", getId())
            .append("orderType", getOrderType())
            .append("orderCode", getOrderCode())
            .append("orderBatch", getOrderBatch())
            .append("orderDate", getOrderDate())
            .append("validDate", getValidDate())
            .append("supplierId", getSupplierId())
            .append("storageId", getStorageId())
            .append("warehouseId", getWarehouseId())
            .append("desStorageId", getDesStorageId())
            .append("desWarehouseId", getDesWarehouseId())
            .append("processorId", getProcessorId())
            .append("outboundOrderId", getOutboundOrderId())
            .append("barcode", getBarcode())
            .append("jadeCategoryId", getJadeCategoryId())
            .append("jadeWeight", getJadeWeight())
            .append("jadeQuantity", getJadeQuantity())
            .append("jadeCost", getJadeCost())
            .append("jadeTagPrice", getJadeTagPrice())
            .append("jadeSoldPrice", getJadeSoldPrice())
            .append("settlementType", getSettlementType())
            .append("settlementRatio", getSettlementRatio())
            .append("isSettle", getIsSettle())
            .append("settleTime", getSettleTime())
            .append("settleBy", getSettleBy())
            .append("isReview", getIsReview())
            .append("reviewUserId", getReviewUserId())
            .append("reviewOk", getReviewOk())
            .append("reviewTime", getReviewTime())
            .append("createBy", getCreateBy())
            .append("createTime", getCreateTime())
            .append("updateBy", getUpdateBy())
            .append("updateTime", getUpdateTime())
            .append("status", getStatus())
            .append("delFlag", getDelFlag())
            .append("remark", getRemark())
            .append("tenantId", getTenantId())
            .append("deptId", getDeptId())
            .toString();
    }
}
